
//页面宽度设置
(function (win) {
	var doc = win.document;
	var docEl = doc.documentElement;
	var tid;

	function refreshRem() {
		var aa = 20 * document.documentElement.clientWidth / 320;
		var rem = aa - 40 > 0 ? 40 : aa;
		docEl.style.fontSize = rem + 'px'
	}

	win.addEventListener('resize', function () {
		clearTimeout(tid);
		tid = setTimeout(refreshRem, 300);
	}, false);
	win.addEventListener('pageshow', function (e) {
		if (e.persisted) {
			clearTimeout(tid);
			tid = setTimeout(refreshRem, 300);
		}
	}, false);

	refreshRem();

})(window);
